package mrsimulator;

/**
 * Created with IntelliJ IDEA.
 * User: codefish
 * Date: 11/7/12
 * Time: 3:27 PM
 * To change this template use File | Settings | File Templates.
 */
public class TaskInfo{

    private long completionTime; // in milisec
    private long outputSize; // in bytes
    private TASK_TYPE taskType;

    public TaskInfo(long completionTime, long outputSize, TASK_TYPE taskType) {
        this.completionTime = completionTime;
        this.outputSize = outputSize;
        this.taskType = taskType;
    }

    public static enum TASK_TYPE {MAP, REDUCE}

    public long getCompletionTime() {
        return completionTime;
    }

    public void setCompletionTime(long completionTime) {
        this.completionTime = completionTime;
    }

    public long getOutputSize() {
        return outputSize;
    }

    public void setOutputSize(long outputSize) {
        this.outputSize = outputSize;
    }

    /*
    public TaskInfo(long completionTime,
    		long outputSize, boolean isMapTask) {
        this.completionTime = completionTime;
        this.outputSize = outputSize;
        this.isMapTask = isMapTask;
    }
    */

    public boolean isMap(){
        return taskType == TASK_TYPE.MAP;
    }

    public boolean isReduce(){
        return taskType == TASK_TYPE.REDUCE;
    }
}
